<div class="wrapper wrapper-content animated fadeInRight article">
    <div class="container">
        <div class="row">
            <div class="col-md-9">
                <?php foreach ($post as $item): ?>
                    <div class="ibox">
                        <div class="ibox-content">
                            <div class="pull-left">
                                <?php if ($item['cat_id']) { ?>
                                    <a href="#" data-id="<?php echo $item['cat_id']; ?>" class="btn btn-outline btn-primary btn-sm">
                                        <?php echo $item['cat']['cat_name']; ?>
                                    </a>
                                <?php } else { ?>
                                    <a href="javascript:;" class="btn btn-outline btn-primary btn-sm">
                                        暂无分类
                                    </a>
                                <?php } ?>
                            </div>
                            <div class="text-center article-title">
                                <h1><?php echo $item['post_title']; ?></h1>
                            </div>
                            <!--/博文-->
                            <?php echo $item['post_content']; ?>
                            <hr>
                            <!--/end 博文-->
                            <div class="row">
                                <div class="col-md-6">
                                    <h5>标签：</h5>
                                    <?php if ($item['tags']) { ?>
                                        <?php foreach ($item['tags'] as $tag_item): ?>
                                            <span class="badge badge-info"><?php echo $tag_item['tag_name']; ?></span>
                                        <?php endforeach; ?>
                                    <?php }else { ?>
                                        <span class="badge badge-info">空</span>
                                    <?php } ?>
                                </div>
                                <div class="col-md-6">
                                    <h5>状态：</h5>
                                    <div>
                                        <i class="fa fa-clock-o"></i>
                                        <?php echo date('Y-m-d', $item['post_create_time']); ?>
                                    </div>
                                    <i class="fa fa-eye"></i>
                                    <?php echo $item['post_views'] . ' 阅读'; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 多说评论框 start -->
                    <div style="background-color:#fff;" class="ds-thread" data-thread-key="<?php echo $item['post_id']; ?>" data-title="<?php echo $item['post_title']; ?>" data-url="<?php echo 'http://lovchun.com/welcome/article/' . $item['post_id']; ?>"></div>
                    <!-- 多说评论框 end -->
                <?php endforeach; ?>
            </div>

            <div class="col-md-3">
                <form method="post" action="#" class="panel-body">
                    <div class="input-group">
                        <input type="text" name="keyword" class="form-control">
                        <span class="input-group-btn">
                            <button type="submit" class="btn btn-primary">
                                <i class="fa fa-search"></i>
                            </button>
                        </span>
                    </div>
                </form>

                <div class="panel panel-primary">
                    <div class="panel-heading">
                        最新文章
                    </div>
                    <ul class="list-group">
                        <?php foreach ($post_list as $item): ?>
                            <li class="list-group-item">
                                <a href="/welcome/article/<?php echo $item['post_id']; ?>" title="<?php echo date('Y-m-d', $item['post_create_time']); ?>">
                                    <?php echo $item['post_title']; ?>
                                </a>
                            </li>
                        <?php endforeach; ?>
                    </ul>
                </div>

                <div class="panel panel-primary">
                    <div class="panel-heading">
                        分类
                    </div>
                    <ul class="list-group">
                        <?php foreach ($cat_list as $item): ?>
                            <li class="list-group-item">
                                <span class="badge badge-default"><?php echo $item['count']; ?></span>
                                <a href="#" data-id="<?php echo $item['cat_id']; ?>"><?php echo $item['cat_name']; ?></a>
                            </li>
                        <?php endforeach; ?>
                    </ul>
                </div>

                <div class="panel panel-primary">
                    <div class="panel-heading">
                        标签
                    </div>
                    <div class="panel-body">
                        <?php foreach ($tag_list as $item): ?>
                            <a class="btn btn-outline btn-link" href="#" data-id="<?php echo $item['tag_id']; ?>">
                                <?php echo $item['tag_name']; ?>
                            </a>
                        <?php endforeach; ?>
                    </div>
                </div>

            </div>
        </div>
    </div>

    <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
    <script type="text/javascript">
        var duoshuoQuery = {short_name: "whouu"};
        (function () {
            var ds = document.createElement('script');
            ds.type = 'text/javascript';
            ds.async = true;
            ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
            ds.charset = 'UTF-8';
            (document.getElementsByTagName('head')[0]
                    || document.getElementsByTagName('body')[0]).appendChild(ds);
        })();
    </script>
    <!-- 多说公共JS代码 end -->
